/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* gftp2 - Main Window
 *
 * Author: Lingtao Pan <freeplant@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef GFTP_INTERFACE_H
#define GFTP_INTERFACE_H


enum {
    COLUMN_DL_FILENAME = 0,
    COLUMN_DL_ACTION,
    COLUMN_DL_PROGRESS,
    COLUMN_DL_PROGRESS_TEXT,
    COLUMN_DL_TYPE,
    COLUMN_DL_RATE,
    COLUMN_DL_ENTRY,
    COLUMNS_DL
};

typedef struct GftpInterface {
    GtkWidget *window;
    GtkWidget *openurl_btn;
    GtkWidget *stop_btn;
    GtkWidget *hostedit;
    GtkWidget *useredit;
    GtkWidget *passedit;
    GtkWidget *portedit;
    GtkWidget *optionmenu;

    GtkWidget *dldbtn;
    GtkWidget *uldbtn;

    GtkActionGroup *main_action_group;
    GtkActionGroup *transfer_action_group;

    GtkWidget  *logwdw;
    GtkTextMark *logwdw_textmark;
    GtkAdjustment *logwdw_vadj;

    GtkWidget *dlbox;
    GtkWidget *dlup_button;
    GtkWidget *dldown_button;
    GtkWidget *dltreeview;
    GtkTreeStore *dlstore;

    GtkStatusbar *statusbar;
    GtkStatusbar *dlstatus;
    GtkProgressBar  *prgbar;
    GtkFrame     *prgframe;
} GftpInterface;



typedef struct gtkui_file_pdata {
    GtkTreeRowReference *rowref;       /* from a gftp_file get the
                                        * corresponding iter in dlwindow */
} gtkui_file_pdata;


GftpInterface *gftp_interface_new ();
void gftp_interface_update_transfer (GftpInterface *intf);

gtkui_file_pdata* alloc_file_pdata (gftp_file *fle);


void enable_progressbar (GftpInterface *interface);
void disable_progressbar (GftpInterface *interface);

void refresh_bookmark_menu ();

#endif
